#include "CMesEntranceApp.h"

QTMESENTRANCE_BEGIN_NAMESPACE

CMesEntranceApp::CMesEntranceApp(QObject *parent)
    : QObject{parent}
{

}


// 初始化
bool CMesEntranceApp::init(bool isServer)
{
    m_isServer = isServer;
    qDebug() << "jxs------------------" << __FUNCTION__ << __LINE__;
    CUserInfo::Instance();
    qDebug() << "jxs------------------" << __FUNCTION__ << __LINE__;
    CNetConfig::Instance();
    qDebug() << "jxs------------------" << __FUNCTION__ << __LINE__;
    return initStorageDb();
}

// 启动网络服务
bool CMesEntranceApp::startNerwork(bool isServer)
{
    if(!isServer){
        return true;
    }
    return controlManage::initServer();
}

// 初始化服务端数据库
bool CMesEntranceApp::initStorageDb()
{
    if(!m_isServer){
        return true;
    }

    bool ret = CUserInfo::Instance().initStorageDb();
    return ret;
}


// 停止服务
void CMesEntranceApp::stop()
{
//    controlManage
}

QTMESENTRANCE_END_NAMESPACE
